import { defineStore } from 'pinia';
import { pageLink } from '/constants/link.ts'

export const useTabbarStore = defineStore('tabbar', {
    state: () => ({
        tabIndex: 0,
        tabList: [{
            icon: '/static/assets/tabbar/fate.png',
            activeIcon: '/static/assets/tabbar/fate_selected.png',
            text: '运势',
            url: pageLink.index
        }, {
            icon: '/static/assets/tabbar/matters.png',
            activeIcon: '/static/assets/tabbar/matters_selected.png',
            text: '问事',
            url: pageLink.matters
        }, {
            icon: '/static/assets/tabbar/blessings.png',
            activeIcon: '/static/assets/tabbar/blessings_selected.png',
            text: '积善',
            url: pageLink.blessings
        }, {
            icon: '/static/assets/tabbar/my.png',
            activeIcon: '/static/assets/tabbar/my_selected.png',
            text: '我的',
            url: pageLink.my
        }]
    }),
    actions: {
        setTabIndex(index: number) {
            this.tabIndex = index;
        }
    }
})